from django.urls import path, re_path, include
from django.views.static import serve
from django.conf import settings
import xadmin

xadmin.autodiscover()
from xadmin.plugins import xversion  # xversion模块自动注册需要版本控制的 Model

xversion.register_models()
urlpatterns = [
    path('xadmin/', xadmin.site.urls),
    path('home/', include('home.urls')),
    path('user/', include('user.urls')),

    # 开放media文件夹
    re_path('media/(?P<path>.*)', serve, {'document_root': settings.MEDIA_ROOT}),
]
